import _ from 'lodash'
export default {
  SET_USER_INFO (state, data) {
    state.userInfo = data
  },
  SET_AUTH_INFO (state, data) {
    state.authInfo = data
  },
  // 存放用户选择的三个科目
  SET_CHOOSE_SUBJECT (state, data) {
    state.chooceSubject = data
  },
  SET_SEARCH_VAL (state, data) {
    state.searchVal = data
  },
  SET_XUAN_SEARCH_VAL (state, data) {
    state.searchXuanVal = data
  },
  SET_HOLLAND_TEST (state, data) {
    if (_.isEmpty(data)) {
      state.hollandTest = data
      return
    }
    for (const keyName in data) {
      state.hollandTest[keyName] = data[keyName]
    }
  },
  SET_HOLLAND_LIST (state, data) {
    if (_.isEmpty(data)) {
      state.hollandList = data
      return
    }
    const { name, value } = data
    state.hollandList[name] = value
  },

  // 备选大学数量
  setSchoolSum (state, data) {
    state.schoolSum = data
  },
  // 备选专业数量
  setMajorSum (state, data) {
    state.majorSum = data
  },
  // 用户是否为第一次进入APP志愿首页
  setFirstCome (state, data) {
    state.firstCome = data
  }
}
